import { PageContainer } from '@ant-design/pro-components';
import InterviewForm from "./components/interviewForm"
import {useState,useEffect} from "react"
import {addInterviewApi} from "@/services/interview"
import {useNavigate} from "umi"
import {message} from "antd"

export default function AddInterview() {
  const [itvInfo ,setItvInfo] = useState({})
  const navigator = useNavigate()
  function submit(tar){
    addInterviewApi(tar).then(res=>{
      console.log(res,"结果");
      navigator('/interview/interviewList')
      message.success('新增成功')

    })
  }
  return (<PageContainer
    header={{
      breadcrumb: {
        items: [
          {
            title: '面试题',
          },
          {
            title: '添加面试题',
          },
        ],
      },
    }} 
  >
    <InterviewForm type="add" initData={itvInfo} submit={submit}/>
  </PageContainer>);
}
